home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / turbotut.arc / BININ.PAS < prev    next >
Pascal/Delphi Source File  |  1989-06-30  |  600b  |  26 lines

  1. PROGRAM binary_input;
  2.  
  3. TYPE input_record = RECORD
  4.        number : INTEGER;
  5.        amount : REAL;
  6.        name   : STRING[30];
  7.      END;
  8.  
  9. VAR input_file : FILE of input_record;
  10.     bird_food  : ARRAY[1..20] OF input_record;
  11.     index      : BYTE;
  12.  
  13. BEGIN  (* main program *)
  14.   ASSIGN(input_file,'KIBBLES.BIT');
  15.   RESET(input_file);
  16.  
  17.   FOR index := 1 TO 20 DO
  18.     IF NOT EOF(input_file) THEN
  19.       READ(input_file,bird_food[index]);
  20.   CLOSE(input_file);
  21.  
  22.   WRITELN(bird_food[6].number:6,bird_food[20].amount:13:5,
  23.           '  ',bird_food[1].name);
  24.  
  25. END.  (* of main program *)
  26.